<?php

namespace app\common\validate;

use think\Validate;

class Rider extends Validate
{
    protected $rule = [
        "username" => "require|unique:rider", 
        "nickname" => "require", 
        "password" => "require|min:6",
        "passwords" => "require|confirm:password",
        "mobile" => "require|mobile|unique:rider",
    ];

    protected $message = [
        "username.require" => "请输入账号",    
        "username.unique" => "该账号已经存在",  

        "nickname.require" => "请输入昵称",  

        "password.require" => "请输入密码", 
        "password.min" => "密码必须大于6位数", 
        "passwords.require" => "请重复确认密码",
        "passwords.confirm" => "两次输入的密码不一致",

        "mobile.require" => "手机号不可以为空", 
        "mobile.mobile" => "手机号格式错误", 
        "mobile.unique" => "该手机号已经存在",  

    ];

    protected $scene = [
        'add' => ['password','nickname','username','mobile'],
        'pass' => ['password','passwords'],
    ];
}
